package com.learn.mapstruct.targetType.factory;

import cn.hutool.core.util.ReflectUtil;
import com.learn.mapstruct.targetType.model.BaseEntityOfTargetType;
import com.learn.mapstruct.targetType.model.BaseEntityOfTargetType2;
import org.mapstruct.Context;
import org.mapstruct.TargetType;

public class TargetTypeFactory {

    public <T extends BaseEntityOfTargetType> T createEntity(@TargetType Class<T> entityClass, @Context String data) {
        return ReflectUtil.newInstance(entityClass);
    }

    public <T extends BaseEntityOfTargetType2> T createEntity2(@TargetType Class<T> entityClass) {
        return ReflectUtil.newInstance(entityClass);
    }


}
